Repository navigation
NUTCH-2887 Migrate to JUnit 5 Jupiter - #862
Conversation
|
For some reason the final plugin test |
|
OK I found an issue. I'm not sure if it is the sole issue but it needs fixed. ```java.lang.NoClassDefFoundError` |
|
It's not Other HTTP protocol tests are failing. |
|
... and the reason is: Simplest solution: revert the changes to |
Update on PR@sebastian-nagel thanks for the comments 👍
Future work considerations
Let me apologize for the change in plan. I realize this PR it a beast. This was not my intention. I spent too much time working on the hanging Ant process(es) due to complications between JUnit 5 in |
sebastian-nagel
left a comment
There was a problem hiding this comment.
+1 lgtm.
Tried locally both ant test and ant test-full which also runs two long-running test classes.
One minor point: at least some of the annotations @org.junit.jupiter.api.Test could be written as @Test.
Phase 2 of NUTCH-2887
This PR is scoped only to migrate
coretests to JUnit 5. Allpluginsstill run on < JUnit 5. This is intended to make the PR easier to interpret and review. I added thejunit-jupiter-enginedependency toivy.xmland removed thevintageflag from thetest-coretarget inbuild.xml. The result is thatcoretests are run as JUnit 5 tests andpluginstests are running as JUnit 4/3 tests.Comments
The following JUnit 3 test cases existed and were first migrated to Unit 4 before being upgraded to JUnit 5.
TestParseSegmentTestMimeUtilTestAdaptiveFetchScheduleContinuousCrawlTestUtilIn some places Hamcrest utility methods were used to improve the readability of JUnit 5 assertions. This is minor and no additional dependency has been introduced. I used the Hamcrest 1.3.0 transitive dependency in the
testscope.I decided to optimize imports in a few classes where it made sense. I think we could consider optimizing imports for the entire Java codebase in a different PR.4
Static imports have been used for all JUnit 5 assertions and assumptions
Next steps
The next PR will focus on migrating all
pluginstests to JUnit 5.